﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;

namespace Example_SeoulOpenAPI.ViewModels
{
    public class Arrival : INotifyPropertyChanged
    {
        protected string _frCode;
        protected string _stationCode;
        protected string _arriveTime;
        protected string _arriveTrainCode;
        protected string _destinationCode;
        protected string _destinationName;

        public Arrival() 
        {
        }
        
        #region Properties

        public string FrCode
        {
            get { return _frCode; }
            set
            {
                if (_frCode != value)
                {
                    _frCode = value;
                    NotifyPropertyChanged("FrCode");
                }
            }
        }

        public string StationCode
        {
            get { return _stationCode; }
            set
            {
                if (_stationCode != value)
                {
                    _stationCode = value;
                    NotifyPropertyChanged("StationCode");
                }
            }
        }

        public string ArriveTime
        {
            get { return _arriveTime; }
            set
            {
                if (value != _arriveTime)
                {
                    _arriveTime = value;
                    NotifyPropertyChanged("ArriveTime");
                }
            }
        }

        public string ArriveTrainCode
        {
            get { return _arriveTrainCode; }
            set
            {
                if (value != _arriveTrainCode)
                {
                    _arriveTrainCode = value;
                    NotifyPropertyChanged("ArriveTrainCode");
                }
            }
        }

        public string DestinationCode
        {
            get { return _destinationCode; }
            set
            {
                if (value != _destinationCode)
                {
                    _destinationCode = value;
                    NotifyPropertyChanged("DestinationCode");
                }
            }
        }

        public string DestinationName
        {
            get { return _destinationName; }
            set
            {
                if (value != _destinationName)
                {
                    _destinationName = value;
                    NotifyPropertyChanged("DestinationName");
                }
            }
        }


        #endregion
        
        
        #region Property Event

        public event PropertyChangedEventHandler PropertyChanged;
        protected void NotifyPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion

    }

    /// <summary>
    /// For line #2 only
    /// </summary>
    public class Line2Arrival : Arrival
    {
        protected string _nextStationCode;
        protected string _nextStationName;

        public Line2Arrival() : base()
        { 
        }
        
        #region Properties

        public string NextStationCode
        {
            get { return _nextStationCode; }
            set
            {
                if (value != _nextStationCode)
                {
                    _nextStationCode = value;
                    NotifyPropertyChanged("NextStationCode");
                }
            }
        }

        public string NextStationName
        {
            get { return _nextStationName; }
            set
            {
                if (value != _nextStationName)
                {
                    _nextStationName = value;
                    NotifyPropertyChanged("NextStationName");
                }
            }
        }

        #endregion

    }
}
